    <script type="text/javascript" src="view/js/jquery.autoresize.js"></script>

    <script type="text/javascript" language="javascript">
     $(document).ready(function() {
          $('#mytextbox').focus(function() {
               $(this).animate({width: '350px'}, 500);
          });
 
          $('#mytextbox').blur(function() {
               $(this).animate({width: '160px'}, 500);
          });
		 
		$("a#mess").click(function() {
			
						$.fancybox.open({
							href : 'view/writeMessage.php?id=<?php echo $_REQUEST['id']; ?>',
							type : 'iframe',
							padding : 5,
							width : 400
						});
					});
			 });
    </script>
    
<?php
	include_once("../model/Model.php");
	$userId = $_REQUEST['id'];
	
	$model = new Model();
	$ans = $model->getFriendList($userId);

	if($ans == 0)
	{
		echo "The person have no friends yet";
	}
	else
	{
		foreach($ans as $row)
		{
			if($row['profilepic'] == "")
			{
				if($row['gender'] == "male")
				{
					$profilepic = "img/male-icon.jpg";
				}
				else
				{
					$profilepic = "img/female-icon.jpg";
				}
			}
			else
			{
				$profilepic = $row['profilepic'];
			}
	?>
						<link rel="stylesheet" href="css/profile.css" type="text/css" media="screen, projection, tv" />
						<script src="js/jquery.min.js"></script>
						<script src="js/script.js"></script>
						<div>
							<div>
								
                                <!--<textarea rows="5" cols="30"></textarea><br />
                                <a href="../index.php?action=showFriendPage&id=<?php echo $row['Id']; ?>" target="_parent" class="linkname"><input  type="submit" value="Save" class="btn" onclick="addMsg();" /></a>-->
								
                                <img alt="" src="<?php echo $profilepic; ?>" width="50" height="50" align="middle" />
								<a href="../index.php?action=sendMsg&id=<?php echo $row['Id']; ?>" target="_parent" class="linkname" id="mess" ><?php echo $row['fullname']; ?></a>
							</div>
						</div>
						<hr>
		<?php
		}
	}
	?>